% Deposit Insurance
clear; close all; clc;

%% Import
filename = 'data_raw/data_combined.xlsx';

data = xlsread(filename);

year          = data(:,1);
deflator      = data(:,2)/100;
limit_nominal = data(:,3);
limit_real    = limit_nominal./deflator;

%% Figure

fontname     = 'Times New Roman';
dimension    = [0 0 8 8];
lw           = 2;
folder       = 'output\';
color        = num2cell(parula(7),2);
% color      = num2cell(jet(7),2);
style        = {'-','--',':','-','--','-','.-'};
marker       = {'none','o','x','s','+'};
markersize   = 10;
fontsize_tit = 22;
fontsize_ax  = 46;
fontsize_lab = 20;
fontsize_leg = 16;

f1 = figure('Units','inches','Position',[0 0 10 6]);
plot(year,limit_real,   'Color',color{1},'LineWidth',lw,'LineStyle',style{1},'Marker',marker{1},'MarkerSize',markersize); hold on
plot(year,limit_nominal,'Color',color{4},'LineWidth',lw,'LineStyle',style{2},'Marker',marker{1},'MarkerSize',markersize); hold on
% ylabel('USD', 'interpreter','latex','FontSize',fontsize_lab,'FontName',fontname);
% xlabel('Year',    'interpreter','latex','FontSize',fontsize_lab,'FontName',fontname);
% title('Deposit Insurance Coverage Limit','interpreter','latex','FontSize',fontsize_tit,'FontName',fontname);
grid; axis tight; box off;
h_leg = legend({'Real (2012)','Nominal'},'Location','NorthWest','Orientation','vertical');
set(h_leg,'FontWeight','bold','FontSize',fontsize_leg,'interpreter','latex');
legend boxoff

axis([1934,2018,0,300000])
% yt = get(gca,'YTick');
% set(gca,'YTickLabel', sprintf('%.f|',yt))
set(gca,'xTick',1935:5:2015)
set(gca,'yTick',0:25000:300000)
ax = gca; ax.YAxis.Exponent = 0; % For decimals, to avoid scientific notation
ytickformat('$%,.0f')
set(gca,'fontsize',12)

title('Deposit Insurance Coverage Limit','interpreter','latex','FontSize',fontsize_tit,'FontName',fontname);

print(f1,'-depsc','-painters','-noui','-r600','DI_level')